import torch.nn as nn

class MusicGenreClassifier(nn.Module):
    def __init__(self, num_classes=10):
        super().__init__()
        self.cnn = nn.Sequential(
            nn.Conv2d(1, 32, kernel_size=3),
            nn.ReLU(),
            nn.MaxPool2d(2),
            nn.Conv2d(32, 64, kernel_size=3),
            nn.ReLU(),
            nn.MaxPool2d(2)
        )
        self.classifier = nn.Linear(64*5*5, num_classes)

    def forward(self, x):
        x = self.cnn(x)
        return self.classifier(x.view(x.size(0), -1))